package com.azier.kapacitor.script.node;

import com.azier.kapacitor.script.method.*;
import com.azier.kapacitor.script.node.nodebind.CommonNodeBind;

import java.util.ArrayList;

/**
* 1 * @Author: luoj
* 2 * @Date: 2019/11/8 11:27
* 3
*/

/**
Create a new Barrier node that emits a BarrierMessage periodically
**/

/**
创建一个新的Barrier节点，该节点定期发出BarrierMessage
**/
public class SideloadNode extends AbstractNode implements CommonNodeBind{
    private static final String name = "sideload";

    public SideloadNode() {
        super(new ArrayList<>(),new ArrayList<>(),name);
    }

    /**
     Define a field default.
     **/
    /**
     定义字段默认值。
     **/
    public SideloadNode field(String name, Object defaults){
        Field field = new Field(name, defaults);
        super.addMethod(field);
        return this;
    }

    public SideloadNode order(String value){
        Order order = new Order(value);
        super.addMethod(order);
        return this;
    }

    public SideloadNode quiet(){
        Quiet quiet = new Quiet();
        super.addMethod(quiet);
        return this;
    }

    public SideloadNode source(String value){
        Source source = new Source(value);
        super.addMethod(source);
        return this;
    }

    public SideloadNode tag(String key, String value){
        Tag tag = new Tag(key, value);
        super.addMethod(tag);
        return this;
    }
}